import request from '@/utils/request'

// 模板分页查询
export function getList(query) {
  return request({
    url: '/base/flow/template/page',
    method: 'get',
    params: query
  })
}
// 模板详情查询
export function getListDet(query) {
  return request({
    url: '/base/flow/template/detail',
    method: 'get',
    params: query
  })
}
// 模板删除
export function deleteList(query) {
  return request({
    url: '/base/flow/template/del?id=' + query,
    method: 'post',
  })
}
// 查询用户列表
export function getUserList(query) {
  return request({
    url: '/base/auth/user/page',
    method: 'get',
    params: query
  })
}

// 查询角色
export function getRoleList(query) {
  return request({
    url: '/base/auth/role/list',
    method: 'get',
    params: query
  })
}
// 新增模板
export function addList(data) {
  return request({
    url: '/base/flow/template/insert',
    method: 'post',
    data: data
  })
}
// 修改模板
export function updateList(data) {
  return request({
    url: '/base/flow/template/update',
    method: 'post',
    data: data
  })
}

// 根据二级菜单id 返回包含模块id的模板名数组
export function moduleList(query) {
  return request({
    url: '/base/flow/template/moduleList',
    method: 'get',
    params: query
  })
}

export function parentIds(query) {
  return request({
    url: '/base/auth/resource/tree/'+query,
    method: 'post',
  })
}
